package 并发编程14.cow;

import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author idea
 * @data 2019/2/4
 */
public class Demo1 {

    public static CopyOnWriteArrayList<String> copyOnWriteArrayList=new CopyOnWriteArrayList<>();


    public static void main(String[] args) {
        copyOnWriteArrayList.add("idea");
        copyOnWriteArrayList.add("idea2");
        copyOnWriteArrayList.add("idea3");
        copyOnWriteArrayList.get(1);
        for (String item : copyOnWriteArrayList) {
            System.out.println(item);
        }
    }
}
